package com.module.third.service.http

import com.module.frame.retrofit.BaseResponse
import com.module.third.learcloud.LCResponse
import com.module.third.qq.bean.QQUserInfo
import com.module.third.wx.bean.WxToken
import com.module.third.wx.bean.WxUserInfo
import retrofit2.http.GET
import retrofit2.http.Query

interface UserInfoService {

    /**
     * 获取微信Token
     */
    @GET("https://api.weixin.qq.com/sns/oauth2/access_token")
    suspend fun getWxToken(
        @Query("appid") appid: String?,
        @Query("secret") secret: String?,
        @Query("code") code: String?,
        @Query("grant_type") grant_type: String?
    ): WxToken

    /**
     * 获取微信用户信息
     */
    @GET("https://api.weixin.qq.com/sns/userinfo")
    suspend fun getWxInfo(
        @Query("access_token") access_token: String?,
        @Query("openid") openid: String?
    ): WxUserInfo

    /**
     * 获取QQ信息
     */
    @GET("https://graph.qq.com/user/get_user_info")
    suspend fun getQQInfo(
        @Query("access_token") access_token: String?,
        @Query("oauth_consumer_key") appId: String?,
        @Query("openid") openid: String?
    ): QQUserInfo

}